package utils;

import com.alibaba.druid.pool.DruidDataSource;

import java.io.UnsupportedEncodingException;

/**
 * @author admin
 */
public class SecurityDateSource extends DruidDataSource {
    @Override
    public void setUsername(String username) {
        try {
            username = Base.decode(username);
        } catch (UnsupportedEncodingException e) {
            e.printStackTrace();
        }
        //调用弗雷的setUname()方法 设置加密后的值进去
        super.setUsername(username);
    }

    @Override
    public void setPassword(String password) {
        try {
            password = Base.decode(password);
        } catch (UnsupportedEncodingException e) {
            e.printStackTrace();
        }
        //调用弗雷的setPassword()方法 设置加密后的值进去
        super.setPassword(password);
    }
}
